﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using LitJson;
using LNet;
using OestsDataBase;
using OestsServer.Net;

namespace OestsServer.Handlers.OESPHandlers
{
	public class DeleteChoiceHandler : HandlerBase<OESPClientChannel>
    {
		public override PacketKey PKey => PacketKey.DeleteChoice;

		public override void Execute(OESPClientChannel client, Request resquestPacket)
		{
			//读取数据库
			List<int> list = JsonMapper.ToObject<List<int>>(resquestPacket.DataStr);
			List<int> bakc = list.Where(i => SubjectChoiceDAL.Delete(i)).ToList();
			ResponsePacket.DataObject = bakc;
			client.Send(ResponsePacket);
		}
	}
}
